<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<t:base type="jquery,easyui,tools,DatePicker"></t:base>
<div class="easyui-layout" fit="true">
<div region="center" style="padding: 1px;">
<t:datagrid name="allAccountDetailList" title="总账账户交易明细" onLoadSuccess="onLoadSuccess" autoLoadData="false"  actionUrl="judicialControll.do?allAccountDetailQuery"   fitColumns="true"
	idField="id" fit="true" queryMode="group" showText="true">
	<%--   update-end--Author:tanghan  Date:20130713 for添加checkbox--%>
	<t:dgCol title="rowkey" field="rowkey" hidden="true" width="120"></t:dgCol>
	<t:dgCol title="账号" field="acctno" width="150"></t:dgCol>
	<t:dgCol title="币种" field="crcycd" width="120"></t:dgCol>
	
	<t:dgCol title="交易日期" field="trandt" width="100"></t:dgCol>
	<%--
	<t:dgCol title="核算机构" field="brchno" width="80"></t:dgCol>
	<t:dgCol title="科目" field="itemcd"   width="50"></t:dgCol>
	<t:dgCol title="户名" field="acctna" width="150"></t:dgCol>
	 --%>
	<t:dgCol title="摘要" field="smrytx" width="200"></t:dgCol>
	<t:dgCol title="借方发生额" field="loanline" width="150"></t:dgCol>
	<t:dgCol title="贷方发生额" field="lenderline" width="120"></t:dgCol>
	<t:dgCol title="余额" field="tranbl"  width="80"></t:dgCol>
	<t:dgCol title="余额方向" field="blncdn" width="80"></t:dgCol>
	<t:dgCol title="交易机构" field="tranbrnm" width="150" ></t:dgCol>
	<t:dgCol title="备注" field="dscrtx" width="60" ></t:dgCol>

</t:datagrid>
<div id="inAllAccountInfoListtb" style="padding: 3px; height: 65px">
	<div align="left">
		科目代码:<select class="easyui-combotree" data-options="url:'itemController.do?getOrgTree',cascadeCheck:false"
	             id="itemSelect" name="itemSelect" datatype="select1">
	         <c:forEach items="${itemList}" var="item">
	             <option value="${item.itemcd }">${item.itemna}</option>
	         </c:forEach>
	     </select>
	     <input id="itemcd" name="itemcd" type="hidden">
	     核算机构: <select class="easyui-combotree" data-options="url:'departController.do?getTree', cascadeCheck:false"
                        id="orgSelect" name="orgSelect" datatype="select1">
                    <c:forEach items="${departList}" var="depart">
                        <option value="${depart.orgCode }">${depart.departname}</option>
                    </c:forEach>
                </select>
             <input id="brchno" name="brchno" type="hidden">
	     币种:<select id="crcycd" name="crcycd" >
	           <option value="">----请选择----</option>
	           <option value="01">人民币</option>
	           <option value="12">英镑</option>
	           <option value="13">港币</option>
	           <option value="14">美元</option>
	           <option value="15">瑞士法郎</option>
	           <option value="18">新加坡元</option>
	           <option value="27">日元</option>
	           <option value="28">加元</option>
	           <option value="29">澳元</option>
	           <option value="38">欧元</option>
	     </select>
	   交易日期:<input id ="trandt_begin" name="trandt_begin">~<input id ="trandt_end" name="trandt_end">
	</div>
	<div align="right">
		<a href="#" class="easyui-linkbutton" iconCls="icon-search" onclick="allAccountDetailListsearch();">查询</a>
	</div>
	<div align="left">
		<a href="#" class="easyui-linkbutton" iconCls="icon-putout" onclick="allAccountDetailListExportXls();">导出</a>
	</div>
</div>


</div>
</div>
<script type="text/javascript">
     $(document).ready(function(){
		$("input[name='trandt_begin']").attr("class","Wdate").attr("style","height:20px;width:90px;").click(function(){WdatePicker({dateFmt:'yyyyMMdd'});});
		$("input[name='trandt_end']").attr("class","Wdate").attr("style","height:20px;width:90px;").click(function(){WdatePicker({dateFmt:'yyyyMMdd'});});
	});
	function isNull(pa){
	  var resp='';
	  if(pa ==null || pa==''){
	    resp+=';';
	  }else{
	  	resp+=pa+ ';';
	  }
	   return resp;
	}
    function getParams(){
		var param;
	   // var acctno= $("input[name='acctno']").val();
	    var itemcd= $("input[name='itemcd']").val();
	    var brchno = $("input[name='brchno']").val();
	    var crcycd= $("#crcycd").val();
	    var trandt_begin= $("input[name='trandt_begin']").val();
	    var trandt_end= $("input[name='trandt_end']").val();
	    
	    param = isNull(itemcd) + isNull(brchno) + isNull(crcycd)+ isNull(trandt_begin) + isNull(trandt_end);
        return param;
    }
    
     function onLoadSuccess(){
       var startkey = getrowkey(1);
       var endkey = getrowkey(0);
       $('#allAccountDetailList').datagrid('options').queryParams={'startkey':startkey,'endkey':endkey,'param':getParams()};
       
    }
    function getrowkey(flag){
        var  rowkey;
    	var datas = $('#allAccountDetailList').datagrid('getRows');
    	var le ;
    	if(flag==0){//下一页
    	   le = $('#allAccountDetailList').datagrid('getData').rows[datas.length-1];
    	}else if(flag==1){//上一页
    	   le = $('#allAccountDetailList').datagrid('getData').rows[0];
    	}else{
    	  le ='';
    	  return '';
    	}
    	if(null != le && le !=''){
	    	for(var i in le){
	    		if(i=='rowkey'){
	    			rowkey=le[i];
    				return rowkey;
	    		}
	    	}
    	}
    }
    function allAccountDetailListExportXls(){
    	var param = getParams();
    	JeecgExcelExport("judicialControll.do?allAccountDetailDown&param="+param,"allAccountDetailList");
    }
   function allAccountDetailListsearch(){
    	var param = getParams();
    	$('#allAccountDetailList').datagrid({
    		url: 'judicialControll.do?allAccountDetailQuery&param='+param+'&field=acctno,acctna,itemcd,brchno,crcycd,rowkey,startdt,enddt,trandt,trandt_begin,trandt_end,acctno,smrytx,loanline,lenderline,tranbl,blncdn,tranbr,dscrtx,tranbrnm,'
    	});
    	
    }
</script>